package com.blb.seckill.controller;

import com.blb.seckill.entity.SeckillCourse;
import com.blb.seckill.service.SeckillCourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;

/**
 * 秒杀课程控制器
 */
@RestController
@RequestMapping("/seckill")
public class SeckillCourseController {

    @Autowired
    private SeckillCourseService seckillCourseService;

    @RequestMapping("/courses")
    public ResponseEntity<List<SeckillCourse>> getTodaySeckillCoursesFromRedis(){
        return ResponseEntity.ok(seckillCourseService.getTodaySeckillCoursesFromRedis());
    }
}
